package com.example.scala.chapter3

import scala.collection.{breakOut, immutable}
import scala.util.control.Breaks

/**
 *
 * Description:
 *
 * Create by lucienoz on 2021/10/15.
 * Copyright © 2021 lucienoz. All rights reserved.
 */
object chapter09 {
	def main(args : Array[String]) : Unit = {

		//break
		Breaks.breakable{
			for(i <- Range(1,10)){
				if (i == 3) Breaks.break //跳出循环
				println(i)
			}
		}

		//continue

		for(i <- Range(1,10)){
			Breaks.breakable {
				if (i == 3) Breaks.break() //通过break操作跳过3
				print ( i + "\t") //1	2	4	5	6	7	8	9
			}
		}


	}

}
